package io.itit.ecp.admin.server.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import icu.mhb.mybatisplus.plugln.base.service.impl.JoinServiceImpl;
import io.itit.ecp.admin.server.entity.DataFillingDetailEntity;
import io.itit.ecp.admin.server.mapper.DataFillingDetailMapper;
import io.itit.ecp.admin.server.service.IDataFillingDetailService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.Collections;
import java.util.List;
import java.util.Set;


@Service
public class DataFillingDetailServiceImpl extends JoinServiceImpl<DataFillingDetailMapper, DataFillingDetailEntity>
        implements IDataFillingDetailService {

    @Override
    public List<DataFillingDetailEntity> findByDataFillingId(String dataFillingId) {
        return list(new LambdaQueryWrapper<DataFillingDetailEntity>().eq(DataFillingDetailEntity::getDataFillingId, dataFillingId));
    }

    @Override
    public List<DataFillingDetailEntity> selectByDataFillingIds(Set<String> dataFillingIds) {
        return CollectionUtils.isEmpty(dataFillingIds) ? Collections.emptyList() :
                list(new LambdaQueryWrapper<DataFillingDetailEntity>().in(DataFillingDetailEntity::getDataFillingId, dataFillingIds));
    }
}
